/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Christopher
 */
import java.util.ArrayList;
import java.util.List;

public class Array<E> extends ColaAbstracta<E> {
    
    private List<E> lista = new ArrayList<E>();
    private Exception i;
    /**
     * 
     * @param e
     * @return boolean
     */
    @Override
    public boolean offer(E e){
        int tam = lista.size();
        E elemento;
        boolean iguales;
        lista.add(e);
        elemento = lista.get(lista.size()-1);
        iguales = elemento.equals(e);
        return iguales;
        
    }
    /**
     * poll
     * @return E 
     */
    @Override
    public E poll() {
        E element;
        if(isEmpty()){
            return null;
        }
        else{
            element = lista.get(0);
            lista.remove(0);
            return element;
        }
    }
/**
     * peek obtiene elemento
     * @return E
     */
    @Override
    public E peek() {
        if(isEmpty()){
            return null;
        }
        else{
            E element;
            element = lista.get(0);
            return element;   
        }
    }
    /**
     * 
     * @return String
     */
    @Override
    public String toString(){
        String desc = "";
        return desc;
    }

}
